With the development of miniaturization of electronic devices such as cellphone, camera etc., imaging devices thereon are also being miniaturized. In varifocal optical systems of the prior art, a clear imaging is generally achieved by focal length switching through a zooming group and a compensating group. However, the structure of such a varifocal optical system is relatively complex, and the total length is relatively long, which cannot satisfy the developing trend of miniaturization of the electronic devices.